#!/usr/bin/python3
# -*- coding:utf-8 -*-
""""
   @Author: 即将拥有人鱼线的yjw
   @Time: 2024/12/5 15:57
   @File: personClient.py
   @desc:
"""
from random import choice

from faker import Faker
from DataTest.tabledata.commonData import randomInfo


#学历：'01'博士 ,'02'硕士,'03'学士,'04'大专,'05'中专,'06'高中,'07'高中及以下,'99'其他
education_code_list = ['01','02','03','04','05','06','07','99']
occupation_code_list = ['01','02','03','04','05','06','07','08','09','10','11','12','13','14','15','16','17','18','19','20','21','22','23','24','25','26','27','28','29','30','31','32','33','34','35','36','37','99']

fake = Faker(locale='zh_CN')

def get_person_client():
    '''
    九要素：
    客户姓名、
    性别、
    国籍、
    职业、
    住所地或者工作单位地址、
    联系方式，
    身份证件或者身份证明文件的种类、号码有效期限
    。客户的住所地与经常居住地不一致的，登记客户的经常居住地。
    :return: 
    '''
    name = fake.name()
    phone = fake.phone_number()
    addList = fake.address().split(' ')
    id_no = fake.ssn()
    birth_date = int(id_no[6:14])
    dict_entries = {
        'client_name': name,
        'client_full_name': name,
        'client_type': '0',
        'nationality_code': 'CHN',
        'gender_code': choice(['0','1']),
        'id_no': id_no,
        'birth_date':birth_date,
        'id_type':'01',
        'id_address': fake.address().split(' ')[0],
        'education_code': choice(education_code_list),
        'occupation_code': choice(occupation_code_list),
        'contact_address':addList[0],
        'email_address':addList[0],
        'work_unit_address':addList[0],
        'zip_code':addList[1],
        'cellphone_number':phone,
        'telephone_number':phone,
        'id_end_date': randomInfo.get_overdue_date(),
        'bank_name':name


    }
    print(dict_entries)
    return dict_entries


if __name__=='__main__':
    # addrList = fake.address()
    # print(addrList)
    get_person_client()